﻿using System;
using System.Collections.Generic;
using System.Text;

namespace belov_test
{
    public class UserInfo
    {
        private string m_name = "";
        private string m_patronymic = "";
        private string m_surname = "";
        private Guid m_guid;
        private int m_passedTests;
        private string m_lastAccountUsing;

        private List<TestResult> m_testsResults = new List<TestResult>();

        public UserInfo()
        {

        }

        public UserInfo(string surname, string name, string patronymic, Guid guid)
        {
            m_name = name;
            m_patronymic = patronymic;
            m_surname = surname;
            m_guid = guid;
        }

        public string Name
        {
            set { m_name = value; }
            get { return m_name; }
        }

        public string Patronymic
        {
            set { m_patronymic = value; }
            get { return m_patronymic; }
        }

        public string Surname
        {
            set { m_surname = value; }
            get { return m_surname; }
        } 

        public Guid Guid
        {
            set { m_guid = value; }
            get { return m_guid; }
        }

        public int PassedTests
        {
            set { m_passedTests = value; }
            get { return m_passedTests; }
        }

        public string LastAccountUsing
        {
            set { m_lastAccountUsing = value; }
            get { return m_lastAccountUsing; }
        }

        public void AddTestResult(TestResult testResult)
        {
            m_testsResults.Add(testResult);
        }

        public int GetTestResultsCount()
        {
            return m_testsResults.Count;
        }

        public TestResult GetTestResult(int index)
        {
            return m_testsResults[index];
        }

        public TestResult GetLastTestResult()
        {
            if (m_testsResults.Count == 0)
                return null;

            return m_testsResults[m_testsResults.Count - 1];
        }
    }
}
